package compiler;

import java.lang.reflect.*;

public class Syntax {

	public String toString() {
		StringBuffer result = new StringBuffer();
		Class<?> cl = this.getClass();
		
		result.append(cl.getSimpleName()).append(" [");
		for (Field f : cl.getFields()) {
			Object o = null;
			try {
				o = f.get(this);
				result.append("\n   ").append(f.getName()).append(" = ").append(o.toString().replace("\n", "\n   "));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		result.append("\n]");
		return result.toString();
	}
}
